package com.nondo.dean.dealer.mapper;

import com.nondo.dean.common.mybatis.Table;
import com.nondo.dean.dealer.domain.StoreProduct;
import com.nondo.dean.dealer.domain.StoreProductExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

@Table("store_product")
@Mapper
public interface StoreProductMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table store_product
     *
     * @mbg.generated Thu May 31 17:36:16 CST 2018
     */
    @SelectProvider(type=StoreProductSqlProvider.class, method="countByExample")
    long countByExample(StoreProductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table store_product
     *
     * @mbg.generated Thu May 31 17:36:16 CST 2018
     */
    @DeleteProvider(type=StoreProductSqlProvider.class, method="deleteByExample")
    int deleteByExample(StoreProductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table store_product
     *
     * @mbg.generated Thu May 31 17:36:16 CST 2018
     */
    @Delete({
        "delete from store_product",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table store_product
     *
     * @mbg.generated Thu May 31 17:36:16 CST 2018
     */
    @Insert({
        "insert into store_product (id, store_id, ",
        "product_id, product_name, ",
        "product_code, sale_price, ",
        "shelf_status, create_by, ",
        "create_date, update_by, ",
        "update_date, remarks, ",
        "del_flag)",
        "values (#{id,jdbcType=INTEGER}, #{storeId,jdbcType=INTEGER}, ",
        "#{productId,jdbcType=INTEGER}, #{productName,jdbcType=VARCHAR}, ",
        "#{productCode,jdbcType=VARCHAR}, #{salePrice,jdbcType=DECIMAL}, ",
        "#{shelfStatus,jdbcType=INTEGER}, #{createBy,jdbcType=BIGINT}, ",
        "#{createDate,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT}, ",
        "#{updateDate,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, ",
        "#{delFlag,jdbcType=CHAR})"
    })
    int insert(StoreProduct record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table store_product
     *
     * @mbg.generated Thu May 31 17:36:16 CST 2018
     */
    @InsertProvider(type=StoreProductSqlProvider.class, method="insertSelective")
    int insertSelective(StoreProduct record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table store_product
     *
     * @mbg.generated Thu May 31 17:36:16 CST 2018
     */
    @SelectProvider(type=StoreProductSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="store_id", property="storeId", jdbcType=JdbcType.INTEGER),
        @Result(column="product_id", property="productId", jdbcType=JdbcType.INTEGER),
        @Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_code", property="productCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="sale_price", property="salePrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="shelf_status", property="shelfStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.BIGINT),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.BIGINT),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    List<StoreProduct> selectByExampleWithRowbounds(StoreProductExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table store_product
     *
     * @mbg.generated Thu May 31 17:36:16 CST 2018
     */
    @SelectProvider(type=StoreProductSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="store_id", property="storeId", jdbcType=JdbcType.INTEGER),
        @Result(column="product_id", property="productId", jdbcType=JdbcType.INTEGER),
        @Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_code", property="productCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="sale_price", property="salePrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="shelf_status", property="shelfStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.BIGINT),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.BIGINT),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    List<StoreProduct> selectByExample(StoreProductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table store_product
     *
     * @mbg.generated Thu May 31 17:36:16 CST 2018
     */
    @Select({
        "select",
        "id, store_id, product_id, product_name, product_code, sale_price, shelf_status, ",
        "create_by, create_date, update_by, update_date, remarks, del_flag",
        "from store_product",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="store_id", property="storeId", jdbcType=JdbcType.INTEGER),
        @Result(column="product_id", property="productId", jdbcType=JdbcType.INTEGER),
        @Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_code", property="productCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="sale_price", property="salePrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="shelf_status", property="shelfStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.BIGINT),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.BIGINT),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    StoreProduct selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table store_product
     *
     * @mbg.generated Thu May 31 17:36:16 CST 2018
     */
    @UpdateProvider(type=StoreProductSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") StoreProduct record, @Param("example") StoreProductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table store_product
     *
     * @mbg.generated Thu May 31 17:36:16 CST 2018
     */
    @UpdateProvider(type=StoreProductSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") StoreProduct record, @Param("example") StoreProductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table store_product
     *
     * @mbg.generated Thu May 31 17:36:16 CST 2018
     */
    @UpdateProvider(type=StoreProductSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(StoreProduct record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table store_product
     *
     * @mbg.generated Thu May 31 17:36:16 CST 2018
     */
    @Update({
        "update store_product",
        "set store_id = #{storeId,jdbcType=INTEGER},",
          "product_id = #{productId,jdbcType=INTEGER},",
          "product_name = #{productName,jdbcType=VARCHAR},",
          "product_code = #{productCode,jdbcType=VARCHAR},",
          "sale_price = #{salePrice,jdbcType=DECIMAL},",
          "shelf_status = #{shelfStatus,jdbcType=INTEGER},",
          "create_by = #{createBy,jdbcType=BIGINT},",
          "create_date = #{createDate,jdbcType=TIMESTAMP},",
          "update_by = #{updateBy,jdbcType=BIGINT},",
          "update_date = #{updateDate,jdbcType=TIMESTAMP},",
          "remarks = #{remarks,jdbcType=VARCHAR},",
          "del_flag = #{delFlag,jdbcType=CHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(StoreProduct record);
}